package cn.dkdoo.redis.repository;

import cn.dkdoo.bean.vo.SendRequest;
import cn.dkdoo.redis.config.RedisConfig;
import cn.dkdoo.redis.config.RedisKeys;
import cn.dkdoo.utils.templateDefault.redis.DefaultRedisTemplate;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;


/**
 * @author nicky
 * @date 2021/5/14 下午6:51
 */
@Repository
public class RedisRepository {
    @Resource(name = RedisConfig.defaultRedisTemplate)
    private DefaultRedisTemplate defaultRedisTemplate;

    public void send(SendRequest request){
        defaultRedisTemplate.leftPush(RedisKeys.DEMO_TEST_TRANSACTIONAL, JSONObject.toJSONString(request));
    }
}
